<%@page import="com.jfinal.kit.PropKit"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<html>

<head>
<meta name="viewport"
	content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">

		<!-- 新 Bootstrap 核心 CSS 文件 -->
		<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">

		<!-- 可选的Bootstrap主题文件（一般不用引入） -->
		<link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

		<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
		<script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>

		<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
		<script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
		<script src="/wx/js/cityinfo.js"></script>
		<script src="/wx/js/weizhang8_all_150619.js"></script>
		<script src="/wx/js/mobile_150629.js"></script>
		<link rel="stylesheet" href="http://tb1.bdstatic.com/??/tb/static-common/style/tb.js/dialog_29a9417.css,/tb/static-common/lib/tbui/style/all_1888f28.css" />
		<link rel="stylesheet" href="http://tb1.bdstatic.com/??/tb/_/index_7712603.css,/tb/_/search_2e2269a.css" />
		<link href="/wx/css/ddSecond.css" type="text/css" rel="stylesheet"/>
		<link href="/wx/css/index_m_150629.css" type="text/css" rel="stylesheet"/>
		<title>修改车辆信息</title>
		<script type="text/javascript">
	
	function carNumcheck(){
		
		var carNum = document.getElementById("my_cphm").value;
		var regCarNum=/^[A-Z_0-9]{5}$/;
		 var carflag = regCarNum.test(carNum);
		if(carNum ==null || carNum ==''){
			alert("车牌号不能为空！");
			return false;
		}else if(!(carflag)){
			alert("车牌号有误！");
			return false;
		}else{
			return true;
		}
	}
	function EngineNumcheck(){
		var EngineNum = document.getElementById("EngineNum").value;
		var regEng=/^[A-Z_0-9]{6,10}$/;
		var engflag = regEng.test(EngineNum);
		if(EngineNum ==null || EngineNum ==''){
			alert("发动机号不能为空！");
			return false;
		}else if(!(engflag)){
			alert("发动机号有误！");
			return false;
		}else{
			return true;
		}
	}
	function FrameNumcheck(){
		var FrameNum = document.getElementById("FrameNum").value;
		var regFrame=/^[A-Z_0-9]{17}$/;
		var framflag = regFrame.test(FrameNum);
		if(FrameNum ==null || FrameNum ==''){
			alert("车架号不能为空！");
			return false;
		}else if(!(framflag)){
			alert("车架号有误！");
			return false;
		}else{
			return true;
		}
	}

		function show() {
			var carNumchecks=carNumcheck();
			var EngineNumchecks=EngineNumcheck();
			var FrameNumchecks=FrameNumcheck();
		/* 	var telchecks=telcheck(); */
			
	/* 		if(carNumchecks==true && EngineNumchecks==true && FrameNumchecks==true && telchecks==true){ */
			if(carNumchecks==true && EngineNumchecks==true && FrameNumchecks==true){
				var EngineNum = document.getElementById("EngineNum").value;
				var FrameNum = document.getElementById("FrameNum").value;
				var Province= document.getElementById("selProvince").value;
				var chepai = document.getElementById("my_jc_select1").value;
				var zimu = document.getElementById("my_jc_select2").value;
				var city = $("#selCity").find("option:selected").text();
		/* 		var telNum=$("#PhoneNum").val(); */
				var carNum = document.getElementById("my_cphm").value;
				
				var pid=document.getElementById("pid").value;
			//	var chepaiNum=document.getElementById("chepai").innerHTML;
				$.ajax({
					type : "POST",
					url : "/person/psave",
					dataType : "json",
					data : {
						
						personCarNum : carNum,
						personEngineNum:EngineNum,
						personFrameNum:FrameNum,
						personProvince:Province,
						personCity : city,
						personchepai:chepai,
						personzimu:zimu,
					/* 	telNum:telNum, */
						pid:pid
					//	chepaiNum:chepaiNum
					
					
						
					},
					success : function(data) {
						if(data!=null){
							var code = data["code"];
							if(code=="1"){
								alert("感谢您的配合!易行丁丁竭诚为您服务");
							}else if(code="2"){
								alert("修改成功！");
							}else
							{
								alert("录制信息失败！");
							}
						}else{
							alert("返回信息为空!");
						}
					},
					error : function(data) {
						alert("录制信息失败！");
					}
				});
			}
		}
		
		function a(ele){
			$("#personBottom").show();
			$(ele).hide();
	        
		}
		$(function(){
			var cheNum=$("#my_jc_select1").val().slice(0,1);
			$("#my_jc_select1").val(cheNum).find("option").eq(0).attr("value",cheNum).html(cheNum);
			var cheZimu=$("#my_jc_select2").val().slice(1,2);
			$("#my_jc_select2").val(cheZimu).find("option").eq(0).attr("value",cheZimu).html(cheZimu);
			var my_cphm=$("#my_cphm").val().slice(2);
			$("#my_cphm").val(my_cphm);
		})
		
		function keyup1(){
			$("#my_cphm").val($("#my_cphm").val().toUpperCase());
		}
		function keyup2(){
			$("#EngineNum").val($("#EngineNum").val().toUpperCase());
		}
		function keyup3(){
			$("#FrameNum").val($("#FrameNum").val().toUpperCase());
		}
</script>
	</head>

	<body>
		<div style="width: 100%;margin: 23px auto;text-align: center">
			<img src="/wx/images/heart.png" style="width:20px"><span style="padding-left:15px">完善车辆信息可以随时查询违章，体验更多功能</span>
		</div>
		    <input type="hidden" value="${person.pid }" id="pid">
			<div style=" width: 90%;text-align: center;color: #fff;background: #fff;border: 1px solid #ccc;margin: 20px auto;border-radius: 7px;">
		 		<div class="top6"> 
			<div class="line line1"></div>
			<div class="line line2"></div>
			<div class="line line3"></div>
			<div class="leftbox" style="color: #000;text-align: right;">
			 <div class="provincese3" style="margin-top: 11px;">	
                		所在城市
			 </div>
			 <div class="provincese3" style="margin-top: 9px;">
                    	车牌号
			 </div> 
			 <div class="provincese3" style="margin-top: 5px;">
                    	发动机号
			 </div>
			  <div class="provincese3" style="margin-top: 10px;">
                    	车架号
			 </div>
			</div>
			<div class="centerbox">
			 			<div class="provincesel" style="width:30%">	
			                 <select name="province" id="selProvince" style="background: none;border: none;color:#a5c0d5"  onChange = "getCity(this.options[this.selectedIndex].value);updateAll()" onFocus=""  class="myselect">
						          <option value="${person.pprovince }" selected>${person.pprovince }</option>
								  <option value="北京">北京</option>
						          <option value="上海">上海</option>
						          <option value="天津">天津</option>
						          <option value="重庆">重庆</option>
						
						          <option value="河北">河北</option>
						          <option value="山西">山西</option>
						          <option value="内蒙古">内蒙古</option>
						          <option value="辽宁">辽宁</option>
						          <option value="吉林">吉林</option>
						          <option value="黑龙江">黑龙江</option>
						
						          <option value="江苏">江苏</option>
						          <option value="浙江">浙江</option>
						          <option value="安徽">安徽</option>
						          <option value="福建">福建</option>
						          <option value="江西">江西</option>
						          <option value="山东">山东</option>
						
						          <option value="河南">河南</option>
						          <option value="湖北">湖北</option>
						          <option value="湖南">湖南</option>
						          <option value="广东">广东</option>
						          <option value="广西">广西</option>
						          <option value="海南">海南</option>
						
						          <option value="四川">四川</option>
						          <option value="贵州">贵州</option>
						          <option value="云南">云南</option>
						          <option value="西藏">西藏</option>
						         <option value="陕西">陕西</option>
						          <option value="甘肃">甘肃</option>
						
						          <option value="宁夏">宁夏</option>
						          <option value="青海">青海</option>
						          <option value="新疆">新疆</option>
			        		</select>
			 			</div>
					<div class="hphmjc">
					 	<div class="hphmjc1">
		                         <select name="province_sn" id="my_jc_select1" style="height:40px;background: none;border: none;color:#a5c0d5"  onChange = ""  class="myselect">
		          <option  value="${person.pcarNum }">${person.pcarNum }</option>
		          <option value="浙">浙</option>
		          <option value="京">京</option>
		          <option value="沪">沪</option>
		          <option value="川">川</option>
		
		          <option value="津">津</option>
		          <option value="渝">渝</option>
		          <option value="鄂">鄂</option>
		          <option value="赣">赣</option>
		          <option value="冀">冀</option>
		          <option value="蒙">蒙</option>
		
		          <option value="鲁">鲁</option>
		          <option value="苏">苏</option>
		          <option value="辽">辽</option>
		          <option value="吉">吉</option>
		          <option value="皖">皖</option>
		          <option value="湘">湘</option>
		
		          <option value="黑">黑</option>
		          <option value="琼">琼</option>
		          <option value="贵">贵</option>
		          <option value="桂">桂</option>
		          <option value="云">云</option>
		          <option value="藏">藏</option>
		
		          <option value="陕">陕</option>
		          <option value="甘">甘</option>
		          <option value="宁">宁</option>
		          <option value="青">青</option>
		          <option value="豫">豫</option>
		          <option value="闽">闽</option>
		
		          <option value="新">新</option>
		          <option value="晋">晋</option>
		        </select>
						</div>
						<div class="hphmjc2">				
		                  <select name="city_sn" id="my_jc_select2" style="width:100%; height:40px;background: none;border: none;color:#a5c0d5" onChange = ""  class="myselect">
		          <option value="${person.pcarNum }">${person.pcarNum }</option>
		          <option value="A">A</option>
		          <option value="B">B</option>
		          <option value="C">C</option>
		
		          <option value="D">D</option>
		          <option value="E">E</option>
		          <option value="F">F</option>
		          <option value="G">G</option>
		          <option value="H">H</option>
		          <option value="I">I</option>
		
		          <option value="J">J</option>
		          <option value="K">K</option>
		          <option value="L">L</option>
		          <option value="M">M</option>
		          <option value="N">N</option>
		          <option value="O">O</option>
		
		          <option value="P">P</option>
		          <option value="Q">Q</option>
		          <option value="R">R</option>
		          <option value="S">S</option>
		          <option value="T">T</option>
		          <option value="U">U</option>
		
		          <option value="V">V</option>
		          <option value="W">W</option>
		          <option value="X">X</option>
		          <option value="Y">Y</option>
		          <option value="Z">Z</option>
		        </select>
						</div>
			 		</div>
			</div>
			<div class="rightbox" >
					<div class="citysel" style=" width: 46px;background: none;border: none;color:#a5c0d5">
	               	<select name="c_id" id="selCity" onChange = "updateAll();"  style="width:120px;background: none;border: none;color:#a5c0d5"   class="myselect" onFocus="getCity($('#selProvince').val())">
					  <option value="${person.pcity }" >${person.pcity }</option>
					</select>
					</div>
					<div class="hphmno" style="accelerator: 10%;margin-top:11px; ">				
	                <input type="text" id="my_cphm" size="10" onkeyup="keyup1()" style="width: 120px;background: none;border: none;color:#a5c0d5"  class="myinput" value="${person.pcarNum }" />
					</div>
					<div class="hphmno3" style="accelerator: 10%;margin-left: -92%;">				
	                <input type="text" id="EngineNum" size="10" onkeyup="keyup2()" style="width: 120px;background: none;border: none;color:#a5c0d5"  class="myinput"  value="${person.pengineNum}"/>
					</div>
					<div class="hphmno3" style="accelerator: 10%; margin-left: -92%;margin-top:14px;">				
	                <input type="text" id="FrameNum" size="10" onkeyup="keyup3()" style="width: 120px;background: none;border: none;color:#a5c0d5"  class="myinput" value="${person.pframeNum }"/>
					</div>
			</div>
		</div>
			</div>
			
		<div style="width:90%;margin:10px auto">
		  <input type="button" class="linear-submit"onclick="show();" value="提交">	
		</div>
		 <script type="text/javascript">

var tt=setInterval(LoadingJS,500); 
function LoadingJS()
{
	//判断js是否加载完成weizhang8_all.js和citydata.js
	try{
		var len=_citylist.length;
		var c=getcityinfo1(1);
		var temp_c=ip_c;
	}catch(e)
	{
		return;
	}
	window.clearInterval(tt); 
	loadjs=1;
	updateipcity();
	updateHistoryCars_m();
	
		$.ajax({
		type :"get",
		url:"",
		timeout : 10000,
		success:showquerylist,
		data:"cityname="+_SelectCity.c_name
		});
	
	SetCookie("olduser","1",365);
}
function showquerylist(data)
{
	document.getElementById("querylist").innerHTML=data;
	ScrollImgLeft();
}



</script> 

<div style="display:none">
<script type="text/javascript">
	var cnzz_protocol = (("https:" == document.location.protocol) ? " https://" : " http://");
	document.write(unescape("%3Cspan id='cnzz_stat_icon_1254868250'%3E%3C/span%3E%3Cscript src='" + cnzz_protocol + "s11.cnzz.com/stat.php%3Fid%3D1254868250' type='text/javascript'%3E%3C/script%3E"));
</script>
</div>
	</body>
</html>